package org.shagin.jfin.sheet;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

import org.shagin.jfin.data.model.OperationRule;

/**
 * The Class SheetColumnOperationRule.
 */
public class SheetColumnOperationRule extends SheetColumnDouble {

	private List<OperationRule> rules = new LinkedList<OperationRule>();

	/**
	 * Instantiates a new sheet column operation rule.
	 *
	 * @param id the id
	 */
	public SheetColumnOperationRule(String id) {
		super(id);
	}

	/**
	 * Gets the rules.
	 *
	 * @return the rules
	 */
	public List<OperationRule> getRules() {
		return Collections.unmodifiableList(rules);
	}

	/**
	 * Adds the rule.
	 *
	 * @param rule the rule
	 */
	public void addRule(OperationRule rule) {
		rules.add(rule);
	}

	/**
	 * Contain rule.
	 *
	 * @param rule the rule
	 * @return true, if successful
	 */
	public boolean containRule(OperationRule rule) {
		return rules.contains(rule);
	}

}
